<template>
  <div class="permission-form">
    <div class="cus-item">
      <div class="cus-label">备授课权限</div>
      <el-switch v-model="sStatus" active-text="开启/关闭"></el-switch>
    </div>
    <div class="cus-item">
      <div class="cus-label">说明</div>
      <span class="description">备授课权限开启时，教师才可看到该课程并进行备授课</span>
    </div>
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  props: {
    hasPermission: {
      type: Boolean,
      default: false,
    },
  },
  setup(props) {
    let sStatus = ref(false);
    console.log(props.hasPermission, sStatus);
    sStatus.value = props.hasPermission;
    const save = (resolve, reject) => {
      resolve({ hasPermission: sStatus.value });
    };
    return { save, sStatus };
  },
};
</script>

<style scoped lang="scss">
.cus-item {
  display: flex;
  margin-bottom: 18px;
}
.cus-label {
  width: 80px;
  font-size: 14px;
}
.description {
  font-size: 14px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #999999;
}
.active-text {
  margin-left: 10px;
}
</style>
